package com.dkm.ec.sale.repository.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.repository.AbstractRepository;
import com.dkm.ec.sale.domain.SaleEntityStat;
import com.dkm.ec.sale.persistence.dao.SaleEntityStatQueryDao;
import com.dkm.ec.sale.persistence.entity.SaleEntityStatPo;
import com.dkm.ec.sale.repository.SaleEntityStatRepository;

/**
 * 对象功能:产品SKU统计 Repository接口的实现类
 * 开发公司:SKG.COM
 * 开发人员:Yuki
 * 创建时间:2015-02-03 16:37:22
 */
@Repository
public class SaleEntityStatRepositoryImpl extends AbstractRepository<String, SaleEntityStatPo,SaleEntityStat> implements SaleEntityStatRepository{
	  
	@Resource
	private  SaleEntityStatQueryDao saleEntityStatQueryDao;

	public SaleEntityStat newInstance() {
		SaleEntityStatPo po = new SaleEntityStatPo();
		SaleEntityStat saleEntityStat = SpringHelper.getBean(SaleEntityStat.class);
		saleEntityStat.setData(po);
		return saleEntityStat;
	}

	public SaleEntityStat newInstance(SaleEntityStatPo po) {
		SaleEntityStat saleEntityStat = SpringHelper.getBean(SaleEntityStat.class);
		saleEntityStat.setData(po);
		return saleEntityStat;
	} 
	
	@Override
	protected IQueryDao<String, SaleEntityStatPo> getQueryDao() {
		return saleEntityStatQueryDao;
	}

	@Override
	public SaleEntityStatPo getBySkuId(String skuId) {
		return saleEntityStatQueryDao.getBySkuId(skuId);
	}
	
	@Override
	public SaleEntityStatPo getByProdId(String prodId) {
		return saleEntityStatQueryDao.getByProdId(prodId);
	}
	
}
